/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.ibrae.excelparser1.mainlogics.datapush;

import ru.ibrae.excelparser1.excelstorageentities.entities.CertificateInfo;
import ru.ibrae.excelparser1.excelstorageentities.entities.PersonInfo;
import ru.ibrae.excelparser1.excelstorageentities.enumerations.Mark;

import java.util.Date;


/**
 *
 * @author pasha
 */
public class PushEntity {
    //~ Instance fields --------------------------------------------------------

    protected CertificateInfo certificate = null;
    protected PersonInfo person           = null;
    protected boolean loadedSuccessfully  = false;
    private PushedIds pushedIds           = new PushedIds();
    private Long organiztionId;

    //~ Constructors -----------------------------------------------------------

    public PushEntity() {}

    public PushEntity(CertificateInfo certificateInfo, PersonInfo personInfo) {
        certificate = certificateInfo;
        person = personInfo;
    }

    public PushEntity(CertificateInfo certificateInfo) {
        certificate = certificateInfo;
    }

    //~ Methods ----------------------------------------------------------------

    public Long getOrganiztionId() {
        return organiztionId;
    }

    public void setOrganiztionId(Long organiztionId) {
        this.organiztionId = organiztionId;
    }

    public Date getWhenGiven() {
        return certificate.getWhenGiven();
    }

    public Mark getStatus() {
        return certificate.getStatus();
    }

    public String getSeries() {
        return certificate.getSeries();
    }

    public String getNumber() {
        return certificate.getNumber();
    }

    /**
     * Get the value of certificate
     *
     * @return the value of certificate
     */
    public CertificateInfo getCertificate() {
        return certificate;
    }

    /**
     * Set the value of certificate
     *
     * @param certificate new value of certificate
     */
    public void setCertificate(CertificateInfo certificate) {
        this.certificate = certificate;
    }

    /**
     * Get the value of loadedSuccessfully
     *
     * @return the value of loadedSuccessfully
     */
    public boolean isLoadedSuccessfully() {
        return loadedSuccessfully;
    }

    /**
     * Set the value of loadedSuccessfully
     *
     * @param loadedSuccessfully new value of loadedSuccessfully
     */
    public void setLoadedSuccessfully(boolean loadedSuccessfully) {
        this.loadedSuccessfully = loadedSuccessfully;
    }

    /**
     * Get the value of person
     *
     * @return the value of person
     */
    public PersonInfo getPerson() {
        return person;
    }

    public void setPerson(PersonInfo person) {
        this.person = person;
    }

    public void setPersonId(Long personId) {
        pushedIds.setPersonId(personId);
    }

    public void setCertificateId(Long certificateId) {
        pushedIds.setCertificateId(certificateId);
    }

    public Long getPersonId() {
        return pushedIds.getPersonId();
    }

    public Long getCertificateId() {
        return pushedIds.getCertificateId();
    }

    //~ Inner Classes ----------------------------------------------------------

    public static class PushedIds {
        protected Long personId;
        protected Long certificateId;

        public PushedIds() {
            this.personId = null;
            this.certificateId = null;
        }

        public Long getPersonId() {
            return personId;
        }

        public void setPersonId(Long personId) {
            this.personId = personId;
        }

        public Long getCertificateId() {
            return certificateId;
        }

        public void setCertificateId(Long certificateId) {
            this.certificateId = certificateId;
        }
    }
}
